Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm/aa64: fix the size of .rela* sections #383

Merged
merged 1 commit into from
Jul 20, 2021
Merged

Conversation

lcp
Copy link
Collaborator

@lcp lcp commented Jun 17, 2021

The previous commit() merged .rel and .dyn* into .rodata, and this
made ld to generate the wrong size for .rela* sections that covered
other unrelated sections. When the EFI image was loaded, _relocate()
went through the unexpected data and may cause unexpected crash.
This commit moves .rel* and .dyn* out of .rodata in the ld script but
also moves the related variables, such as _evrodata, _rodata_size,
and _rodata_vsize, to the end of the new .dyn section, so that the
crafted pe-coff section header for .rodata still covers our new
.rela and .dyn sections.

() 212ba30 ("arm/aa64 targets: put .rel and .dyn* in .rodata")

Fix issue: #371

Signed-off-by: Gary Lin glin@suse.com

The previous commit(*) merged .rel* and .dyn* into .rodata, and this
made ld to generate the wrong size for .rela* sections that covered
other unrelated sections. When the EFI image was loaded, _relocate()
went through the unexpected data and may cause unexpected crash.
This commit moves .rel* and .dyn* out of .rodata in the ld script but
also moves the related variables, such as _evrodata, _rodata_size,
and _rodata_vsize, to the end of the new .dyn section, so that the
crafted pe-coff section header for .rodata still covers our new
.rela and .dyn sections.

(*) 212ba30 ("arm/aa64 targets: put .rel* and .dyn* in .rodata")

Fix issue: rhboot#371

Signed-off-by: Gary Lin <glin@suse.com>
@vathpela vathpela merged commit 34e3ef2 into rhboot:main Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants